home *** CD-ROM | disk | FTP | other *** search
/ Personal Computer World 2009 February / PCWFEB09.iso / Software / Linux / SLAX 6.0.8 / slax-6.0.8.iso / slax / base / 006-devel.lzm / usr / include / kdatetimewidget.h < prev    next >
Encoding:
C/C++ Source or Header  |  2005-10-10  |  2.4 KB  |  93 lines

  1. /* This file is part of the KDE libraries
  2.    Copyright (C) 2002 Hans Petter bieker <bieker@kde.org>
  3.  
  4.    This library is free software; you can redistribute it and/or
  5.    modify it under the terms of the GNU Library General Public
  6.    License version 2 as published by the Free Software Foundation.
  7.  
  8.    This library is distributed in the hope that it will be useful,
  9.    but WITHOUT ANY WARRANTY; without even the implied warranty of
  10.    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
  11.    Library General Public License for more details.
  12.  
  13.    You should have received a copy of the GNU Library General Public License
  14.    along with this library; see the file COPYING.LIB.  If not, write to
  15.    the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
  16.    Boston, MA 02110-1301, USA.
  17. */
  18.  
  19. #ifndef __KDATETIMEWIDGET__
  20. #define __KDATETIMEWIDGET__
  21.  
  22. #include <qwidget.h>
  23. #include <qdatetime.h>
  24.  
  25. #include <kdelibs_export.h>
  26.  
  27. /**
  28.  * @short A combination of a date and a time selection widget.
  29.  *
  30.  * This widget can be used to display or allow user selection of date and time.
  31.  *
  32.  * @see KDateWidget
  33.  *
  34.  * \image html kdatetimewidget.png "KDE Date Time Widget"
  35.  *
  36.  * @author Hans Petter Bieker <bieker@kde.org>
  37.  * @version $Id: kdatetimewidget.h 465272 2005-09-29 09:47:40Z mueller $
  38.  * @since 3.2
  39.  */
  40. class KDEUI_EXPORT KDateTimeWidget : public QWidget
  41. {
  42.   Q_OBJECT
  43.   Q_PROPERTY( QDateTime dateTime READ dateTime WRITE setDateTime )
  44.  
  45. public:
  46.   /**
  47.    * Constructs a date and time selection widget.
  48.    */
  49.   KDateTimeWidget(QWidget * parent = 0, const char * name = 0);
  50.  
  51.   /**
  52.    * Constructs a date and time selection widget with the initial date and
  53.    * time set to @p datetime.
  54.    */
  55.   KDateTimeWidget(const QDateTime & datetime,
  56.                   QWidget * parent = 0, const char * name = 0 );
  57.  
  58.   /**
  59.    * Destructs the date and time selection widget.
  60.    */
  61.   virtual ~KDateTimeWidget();
  62.  
  63.   /**
  64.    * Returns the currently selected date and time.
  65.    */
  66.   QDateTime dateTime() const;
  67.  
  68. public slots:
  69.   /**
  70.    * Changes the selected date and time to @p datetime.
  71.    */
  72.   void setDateTime(const QDateTime & datetime);
  73.  
  74. signals:
  75.   /**
  76.    * Emitted whenever the date or time of the widget
  77.    * is changed, either with setDateTime() or via user selection.
  78.    */
  79.   void valueChanged(const QDateTime & datetime);
  80.  
  81. private:
  82.   void init();
  83.  
  84. private slots:
  85.   void slotValueChanged();
  86.  
  87. private:
  88.   class KDateTimeWidgetPrivate;
  89.   KDateTimeWidgetPrivate *d;
  90. };
  91.  
  92. #endif
  93.